package com.czm.art_light.service.impl;

import com.czm.art_light.annotation.DistributedLock;
import com.czm.art_light.entity.ArtUserActions;
import com.czm.art_light.mapper.ArtUserActionsMapper;
import com.czm.art_light.service.ArtUserActionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 用户行为日志信息 服务类
 */
@Service
public class ArtUserActionsServiceImpl implements ArtUserActionsService {
    @Autowired
    private ArtUserActionsMapper artUserActionsMapper;

    /**
     * 记录用户的操作行为
     */
    @DistributedLock (
            prefix = "recordUserActions",
            lockKey = "#artUserActions.workId + '::' + #artUserActions.actionType"
    )
    @Override
    public void recordUserActions(ArtUserActions artUserActions) {
        artUserActionsMapper.recordUserActions(artUserActions);
    }
}
